<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //实现一个函数makeAdder，接受一个数字作为参数，返回一个新的函数，
      //该函数可以将传入的参数与makeAdder函数的参数进行相加并返回结果
      // const addFive = makeAdder(5)
      const makeAdder = (num1) => {
        return function (num2) {
          return num1 + num2
        }
      }
      const addFive = makeAdder(5)
      console.log(addFive(10))
      console.log(addFive(20))
    </script>
  </body>
</html>
